1. Field of the Invention
The present invention relates to a distance measurement apparatus and method for measuring a distance to a subject. The invention also relates to a computer readable recording medium on which is recorded a program for causing a computer to perform the distance measurement method.
2. Description of the Related Art
As a method for measuring distance to a subject, a phase shift method is known. The phase shift method is a method in which stripe pattern light that sinusoidally changes in intensity is repeatedly emitted to a subject, while shifting the phase of the pattern by π/2, until the phase of the stripe pattern light is shifted one cycle, reflected light is received at four phases of 0, π/2, π, and 3π/2 in the phase shift cycle of the stripe pattern light to obtain received light signals according to the amount of received light, and a phase delay (phase difference) between the stripe pattern light and reflected light is detected by each light receiving element of an image sensor provided in a photographing device based on the received light signals, whereby distance information is calculated.
Here, when measuring a distance by the phase shift method, luminance represented by the received light signal may sometimes be saturated or the contrast of the received light signal may sometimes be decreased due to a change in material properties of the surface of a subject or a change in the surface of the subject. In such a case, the distance can not be measured accurately. Consequently, for a received light signal having saturated luminance or a low contrast, a method for determining the reliability of a phase difference calculated by the light receiving element using received light signals of light receiving elements surrounding the light receiving element is proposed as described, for example, in Japanese Unexamined Patent Publication No. 2006-023178.
The method described in Japanese Unexamined Patent Publication No. 2006-023178, however, may sometimes obtain a received light signal which is not suitable for distance measurement due to, for example, defective emission of stripe pattern light, reception of outside light other than the reflected light, output of received light signal not proportional to the amount of reflected light due to malfunction of the light receiving element, or the like. Use of such a received light signal which is not suitable for distance measurement may result in the calculation of erroneous distance information.
The present invention has been developed in view of the circumstances described above, and it is an object of the present invention to prevent erroneous distance measurement when measuring a distance by a phase shift method.